<script setup lang="ts">
import {ref,provide} from 'vue';
import ParentComp from './components/ParentComp.vue';

const money = ref(1000000)
const payMoney = (count:number) => {
  money.value -=count
}

// 后代provide
// 提供数据
provide('money', money)
provide('payMoney',payMoney)
</script>

<template>
  <div class="app-page" style="border: 10px solid #ccc; padding: 50px; width: 600px">
    app 组件 
    <ParentComp />
  </div>
</template>